package com.laotou99.wmsjjj.wmsjjj.constant;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;

//Constant
public class C {

	private static int iRnd,iRnd2;
	private static Random rnd1;
	
	private final static Map<String,Object> m1 = new HashMap<String, Object>();

	public static int getRnd1() {

		iRnd  = (int)(Math.random()*100); 
		return iRnd;
	}

	public static int getRnd2() {
 
		iRnd2  = (int)(Math.random()*10000);
		return iRnd2;
	}

	public static boolean isEmptyValue(Object oj1) {
		// TODO Auto-generated method stub 
		return isEmpty(oj1);
	}

	/**
	 * 判断对象是否Empty(null或元素为0)<br>
	 * 实用于对如下对象做判断:String Collection及其子类 Map及其子类
	 * 
	 * @param pObj
	 *            待检查对象
	 * @return boolean 返回的布尔值
	 */
	public static boolean isEmpty(Object pObj) {
		if (pObj == null)
			return true;
		if (pObj == "")
			return true;
		if (pObj instanceof String) {
			if (((String) pObj).length() == 0) {
				return true;
			}
		} else if (pObj instanceof Collection) {
			if (((Collection) pObj).size() == 0) {
				return true;
			}
		} else if (pObj instanceof Map) {
			if (((Map) pObj).size() == 0) {
				return true;
			}
		}
		return false;
	}

}
